package test.demo.support;

import test.demo.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @author: JC
 * @date: 2023/4/4 23:08
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

    private Map<String,Object> singletonObjects = new HashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    protected  void addSingleton(String beanName,Object obj){
        singletonObjects.put(beanName, obj);
    }
}
